package cn.edu.ustc.xrovers.action;

import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import cn.edu.ustc.xrovers.model.BalanceSheet;
import cn.edu.ustc.xrovers.model.CashFlowStatement;
import cn.edu.ustc.xrovers.model.Company;
import cn.edu.ustc.xrovers.model.IncomeStatement;
import cn.edu.ustc.xrovers.service.HandleCompanyInfoService;
import com.opensymphony.xwork2.ActionSupport;

/**
 * 处理企业财务信息的Action
 * @author paddy
 *
 */
public class CoFinInfoAction extends ActionSupport {

	private BalanceSheet bs;
	private CashFlowStatement cfs;
	private IncomeStatement is;
	private HandleCompanyInfoService hci;
	
	/**
	 * 保存企业财务信息
	 */
	public String insertCoFinInfo() throws Exception {
		HttpSession session=ServletActionContext.getRequest().getSession();
		boolean flag=hci.saveCoFinInfo(session, bs, cfs, is);
		if(flag)
			return SUCCESS;
		else
			return INPUT;
	}
	
	/**
	 * 保存担保企业的财务信息
	 * @return
	 * @throws Exception
	 */
	public String insertGuaFinInfo() throws Exception {
		HttpSession session=ServletActionContext.getRequest().getSession();
		boolean flag=hci.saveGuaFinInfo(session, bs, cfs, is);
		if(flag)
			return SUCCESS;
		else
			return INPUT;
	}
	
	
	/*getset方法*/
	public BalanceSheet getBs() {
		return bs;
	}
	public void setBs(BalanceSheet bs) {
		this.bs = bs;
	}
	public CashFlowStatement getCfs() {
		return cfs;
	}
	public void setCfs(CashFlowStatement cfs) {
		this.cfs = cfs;
	}
	public IncomeStatement getIs() {
		return is;
	}
	public void setIs(IncomeStatement is) {
		this.is = is;
	}


	public void setHci(HandleCompanyInfoService hci) {
		this.hci = hci;
	}


	public HandleCompanyInfoService getHci() {
		return hci;
	}
}
